package com.register.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.register.pojo.QRUserAndDepot;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface QRUserAndDepotMapper extends BaseMapper<QRUserAndDepot> {

    @Select("select a.*,b.username,b.phone,c.name " +
            "from qr_user_and_depot a " +
            "left join sys_users b on a.userid = b.id " +
            "left join qr_depot c on a.depotid = c.id " +
            "order by a.userid")
    List<Map<String,Object>> getUserAndDepotOrderByUserId();

    @Select("select a.*,b.username,b.phone,c.name " +
            "from qr_user_and_depot a " +
            "left join sys_users b on a.userid = b.id " +
            "left join qr_depot c on a.depotid = c.id " +
            "order by a.depotid")
    List<Map<String,Object>> getUserAndDepotOrderByDepId();
}
